jQuery(document).ready(function() {
	//创建JQGRID表格
	var grid = $("#table1").ligerGrid({
        columns: [
                  { display: 'ERP领料单号', name: 'getProCode', width: 200},
                  { display: 'MES领料单号', name: 'oriCode', width: 200},
                  { display: '状态', name: 'billStatus',hide:true, width: 140,
                	render : function(item){
                		if (item.billStatus == 0)
                			return "草稿";
                		if (item.billStatus == 1)
                			return "审批中";
                		if (item.billStatus == 2)
                			return "完成";
                	}  
                  },
                  { display: '领料状态', name: 'isnotck', width: 150,
                  	render : function(item){
                  		if (item.isnotck == 0)
                  			return "未领料";
                  		if (item.isnotck == 1)
                  			return "部分领料";
                  		if (item.isnotck == 2)
                  			return "全部领料";
                  	}  
                    },
                  { display: '制单时间', name: 'dctime', width: 150,
                	  render: function (item){
                		  var cdate=new Date(item.dctime);
                		  return formatDate(cdate,"yyyy-MM-dd");
                	  }
                  },
                  { display: '制单人员', name: 'dcruser', width: 150 }
                  ],  usePager: true,pageSize:15,
              	  pageSizeOptions :[15,25,35],
                      url : basic_Url+"/list.do",
                      width: '100%', height: '98%', checkbox: true,rownumbers:true,
                      enabledSort:false,
                      onDblClickRow : function (data, rowindex, rowobj){
                          edit(data);
                       }
                  });
	$("#pageloading").hide();
	
	
});

/*
function checkdel(){
	var manager = $("#table1").ligerGetGridManager(); 
	var rows =manager.getSelectedRows();
	if (rows==null || 0 == rows.length){
			$.dialog.alert('请选择需要操作删除的行！');
			return;
		}
	var canDel = true;
		$(rows).each(function() {
			if (this.billStatus!=0){
				canDel = false;
				$.dialog.alert('此行不能进行删除操作！');
			}
		});
		
		if(canDel){
			del();
		}
	
}*/
